<template>
	<view>
		<view>
			<!-- 提示信息弹窗 -->
			<uni-popup ref="message" type="message">
				<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
			</uni-popup>
		</view>
		<!-- 	<uni-section title="工单信息" type="line" padding>
			<uni-steps :options="list1" :active="active" />
			<uni-card title="操作记录" :thumbnail="avatar">
				<view style="display: flex; flex-direction: column" v-for="(item, index) in OrderInfoList" :key="index">
					<text>订单号：{{ item.oid }}</text>
					<text>创建人：{{ item.createBy }}</text>
					<text>最新操作时间：{{ item.updateTime }}</text>
					<text>备注：{{ item.remark }}</text>
				</view>
			</uni-card>
		</uni-section>
		<uni-card title="工单信息" :thumbnail="avatar">
			<view class="order-txt">
				<text class="">标题：{{ cusinform.title }}</text>
				<text class="">内容：{{ cusinform.content }}</text>
				<text class="">创建人：{{ cusinform.defaultAddress.userName }}</text>
				<text class="">联系电话：{{ cusinform.defaultAddress.phone }}</text>
				<text class="">订单号：{{ cusinform.orderNum }}</text>
				<text class="">创建时间：{{ cusinform.createTime }}</text>
			</view>
		</uni-card> -->
		<uni-card v-show="deviceShow" title="设备档案" :thumbnail="avatar">
			<view class="order-txt">
				<text class="">设备名称：{{ deviceInform.name }}</text>
				<text class="">编码：{{ deviceInform.code }}</text>
				<text class="">型号：{{ deviceInform.model }}</text>
				<text class="">类型：{{ deviceInform.deviceClass.typeName }}</text>
				<text class="">位置：{{ deviceInform.location }}</text>
				<text class="">创建人：{{ deviceInform.createBy }}</text>
				<text class="">工厂：{{ deviceInform.manufacturer }}</text>
				<text class="">购买时间：{{ deviceInform.buyDate }}</text>
				<text class="">创建时间：{{ deviceInform.createTime }}</text>
				<text class="">备注：{{ deviceInform.remark }}</text>
				<view v-show="deviceInform.enlarge!=null" style="display: flex; flex-direction: column" v-for="(item, index) in enlarge" :key="index">
					<text class="">{{ item.lable }}：{{ item.value }}</text>
				</view>
			</view>
		</uni-card>
<!-- 		<uni-card title="保养信息" :thumbnail="avatar">
			<view class="order-txt">
				<text class="">设备名：{{ maintenanceInfo.name }}</text>
				<text class="">设备编码：{{ maintenanceInfo.code }}</text>
				<text class="">巡检人：{{ maintenanceInfo.serverName }}</text>
				<text class="">联系电话：{{ maintenanceInfo.servicephonenumber }}</text>
				<text class="">处理时间：{{ maintenanceInfo.acceptTime }}</text>
			</view>
		</uni-card>
		<uni-card title="保养信息" :thumbnail="avatar">
			<view class="order-txt">
				<text class="">设备名：{{ maintenanceInfo.name }}</text>
				<text class="">设备编码：{{ maintenanceInfo.code }}</text>
				<text class="">巡检人：{{ maintenanceInfo.serverName }}</text>
				<text class="">联系电话：{{ maintenanceInfo.servicephonenumber }}</text>
				<text class="">处理时间：{{ maintenanceInfo.acceptTime }}</text>
			</view>
		</uni-card> -->
	</view>
</template>

<script>
	import {
		getdeviceInfo,
		getDevicemaintenanceInfoById
	} from '@/api/system/user.js';
	import store from '@/store/index.js';
	export default {
		data() {
			return {
				//扩展字段
				enlarge: [{
					lable: '',
					value: '',
					key: ''
				}],
				active: 0,
				deviceShow: true,
				maintenanceInfo: '',
				deviceInform: '',
				type: 'center',
				msgType: 'success',
				messageText: '这是一条成功提示',
				SerImgsData: [],
				cusinform: '',
				OrderInfoList: '',
				value: '',
			};
		},
		onLoad() {
			this.getDetail();
		},
		methods: {
			getDetail() {
				this.cusinform = store.state.CusImform;
				getdeviceInfo(this.cusinform.id).then((res) => {
					this.deviceInform = res.data;
					this.enlarge = res.data.enlarge != null ? res.data.enlarge : [];
				});
/* 				getDevicemaintenanceInfoById(this.cusinform.id).then((res) => {
					this.maintenanceInfo = res.data;
				}) */
			},
		}
	};
</script>
<style lang="scss">
	.order-txt {
		display: flex;
		flex-direction: column;
	}
</style>